const { INTEGER, STRING, TINYINT, DATE, Model } = require('sequelize');
const db = require('../../helpers/db');

class SKU extends Model {}

SKU.init(
    {
        id: {
            type: INTEGER,
            autoIncrement: true,
            primaryKey: true,
            comment: 'SKU ID'
        },
        name: {
            type: STRING(32),
            allowNull: false,
            comment: 'SKU名称'
        },
        code: {
            type: STRING(32),
            allowNull: false,
            comment: 'SKU英文代号'
        },
        type: {
            type: TINYINT,
            defaultValue: 0,
            comment: 'SKU类型，0单选，1多选，2范围'
        }
    },
    {
        tableName: 'user',
        underscored: true,
        sequelize: db
    }
);

module.exports = SKU;
